\(\int \csc ^2(e+f x) (a+b \tan ^2(e+f x)) \, dx\) [40]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 24 \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {a \cot (e+f x)}{f}+\frac {b \tan (e+f x)}{f} \]

[Out]

-a*cot(f*x+e)/f+b*tan(f*x+e)/f

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3744, 14} \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {b \tan (e+f x)}{f}-\frac {a \cot (e+f x)}{f} \]

[In]

Int[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Cot[e + f*x])/f) + (b*Tan[e + f*x])/f

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3744

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff^(m + 1)/f), Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)
^(m/2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {a+b x^2}{x^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (b+\frac {a}{x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {a \cot (e+f x)}{f}+\frac {b \tan (e+f x)}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {a \cot (e+f x)}{f}+\frac {b \tan (e+f x)}{f} \]

[In]

Integrate[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Cot[e + f*x])/f) + (b*Tan[e + f*x])/f

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {b \tan \left (f x +e \right )-\frac {a}{\tan \left (f x +e \right )}}{f}\) \(25\)
default \(\frac {b \tan \left (f x +e \right )-\frac {a}{\tan \left (f x +e \right )}}{f}\) \(25\)
risch \(-\frac {2 i \left (a \,{\mathrm e}^{2 i \left (f x +e \right )}-b \,{\mathrm e}^{2 i \left (f x +e \right )}+a +b \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(59\)

[In]

int(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(b*tan(f*x+e)-a/tan(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.54 \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {{\left (a + b\right )} \cos \left (f x + e\right )^{2} - b}{f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \]

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-((a + b)*cos(f*x + e)^2 - b)/(f*cos(f*x + e)*sin(f*x + e))

Sympy [F]

\[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{2}{\left (e + f x \right )}\, dx \]

[In]

integrate(csc(f*x+e)**2*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*csc(e + f*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {b \tan \left (f x + e\right ) - \frac {a}{\tan \left (f x + e\right )}}{f} \]

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

(b*tan(f*x + e) - a/tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.41 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {b \tan \left (f x + e\right ) - \frac {a}{\tan \left (f x + e\right )}}{f} \]

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

(b*tan(f*x + e) - a/tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 10.62 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.08 \[ \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {b\,\mathrm {tan}\left (e+f\,x\right )}{f}-\frac {a}{f\,\mathrm {tan}\left (e+f\,x\right )} \]

[In]

int((a + b*tan(e + f*x)^2)/sin(e + f*x)^2,x)

[Out]

(b*tan(e + f*x))/f - a/(f*tan(e + f*x))